﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="KpiForm.aspx.cs" Inherits="kpi.KpiForm_uManager.KpiForm" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>考评用户KPI信息</h2>
        <br />
        <div>
            当前用户：<asp:Label ID="Label_UserName" runat="server" Text="Label"></asp:Label>；
        查看员工KPI：
            <asp:DropDownList ID="DropDownList_SelectMonth" runat="server"></asp:DropDownList>
            <asp:DropDownList ID="DropDownList_UserName" runat="server"></asp:DropDownList>
            <asp:CheckBox ID="CheckBox_ShowDetail" runat="server" Text="包含未确认KPI信息" />
            <asp:Button ID="Button_ShowUserKpi" runat="server" Text="查看" OnClick="Button_ShowUserKpi_Click" />
            <asp:Label ID="Label_DebugMsg" runat="server" Visible="False"></asp:Label>
            <br />
            <asp:Label ID="Label_ErrorMsg" runat="server" Visible="False"></asp:Label>
        </div>
        <div>
            <br />
            <asp:GridView ID="GridView_uMKpiForm" runat="server" OnRowCancelingEdit="GridView_uMKpiForm_RowCancelingEdit" OnRowEditing="GridView_uMKpiForm_RowEditing" OnRowCommand="GridView_uMKpiForm_RowCommand" OnRowCreated="GridView_uMKpiForm_RowCreated" OnRowDataBound="GridView_uMKpiForm_RowDataBound" OnRowUpdating="GridView_uMKpiForm_RowUpdating" ShowFooter="True">
            </asp:GridView>
            <%-- <asp:GridView ID="GridView_uMKpiForm" runat="server"
            AutoGenerateColumns="False" DataKeyNames="id"
            DataSourceID="SqlDataSource_uMKpiForm" BackColor="White"
            BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4">
            <Columns>
                <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True"
                    SortExpression="id" Visible="False" />
                <asp:BoundField DataField="UserName" HeaderText="员工姓名" ReadOnly="True"
                    SortExpression="UserName" />
                <asp:BoundField DataField="u_kpi" HeaderText="关键绩效指标（KPI）" ReadOnly="True"
                    SortExpression="u_kpi" />
                <asp:BoundField DataField="u_kpi_std" HeaderText="考核标准" ReadOnly="True"
                    SortExpression="u_kpi_std" />
                <asp:BoundField DataField="u_kpi_comm" HeaderText="KPI说明" ReadOnly="True"
                    SortExpression="u_kpi_comm" />
                <asp:BoundField DataField="u_kpi_rat" HeaderText="权重" ReadOnly="True"
                    SortExpression="u_kpi_rat" />
                <asp:BoundField DataField="u_kpi_fx" HeaderText="计算方式" ReadOnly="True"
                    SortExpression="u_kpi_fx" />
                <asp:BoundField DataField="u_kpi_rec" HeaderText="自评得分" ReadOnly="True"
                    SortExpression="u_kpi_rec" />
                <asp:BoundField DataField="uM_kpi_rec" HeaderText="考评得分"
                    SortExpression="uM_kpi_rec" />
                <asp:BoundField DataField="u_kpi_ref" HeaderText="信息来源" ReadOnly="True"
                    SortExpression="u_kpi_ref" />
                <asp:BoundField DataField="u_kpi_conf" HeaderText="u_kpi_conf" ReadOnly="True"
                    SortExpression="u_kpi_conf" Visible="False" />
                <asp:BoundField DataField="u_kpi_m" HeaderText="u_kpi_m" ReadOnly="True"
                    SortExpression="u_kpi_m" Visible="False" />
                <asp:CommandField ShowEditButton="True" />
            </Columns>
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <RowStyle BackColor="White" ForeColor="#330099" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <SortedAscendingCellStyle BackColor="#FEFCEB" />
            <SortedAscendingHeaderStyle BackColor="#AF0101" />
            <SortedDescendingCellStyle BackColor="#F6F0C0" />
            <SortedDescendingHeaderStyle BackColor="#7E0000" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource_uMKpiForm" runat="server"
            ConflictDetection="CompareAllValues"
            ConnectionString="<%$ ConnectionStrings:kpi_forms_dbConnectionString %>"
            DeleteCommand="DELETE FROM [u_kpi_table] WHERE [id] = @original_id AND [UserName] = @original_UserName AND [u_kpi] = @original_u_kpi AND [u_kpi_std] = @original_u_kpi_std AND [u_kpi_comm] = @original_u_kpi_comm AND [u_kpi_rat] = @original_u_kpi_rat AND (([u_kpi_fx] = @original_u_kpi_fx) OR ([u_kpi_fx] IS NULL AND @original_u_kpi_fx IS NULL)) AND [u_kpi_rec] = @original_u_kpi_rec AND [uM_kpi_rec] = @original_uM_kpi_rec AND [u_kpi_ref] = @original_u_kpi_ref AND [u_kpi_conf] = @original_u_kpi_conf AND (([u_kpi_m] = @original_u_kpi_m) OR ([u_kpi_m] IS NULL AND @original_u_kpi_m IS NULL))"
            InsertCommand="INSERT INTO [u_kpi_table] ([id], [UserName], [u_kpi], [u_kpi_std], [u_kpi_comm], [u_kpi_rat], [u_kpi_fx], [u_kpi_rec], [uM_kpi_rec], [u_kpi_ref], [u_kpi_conf], [u_kpi_m]) VALUES (@id, @UserName, @u_kpi, @u_kpi_std, @u_kpi_comm, @u_kpi_rat, @u_kpi_fx, @u_kpi_rec, @uM_kpi_rec, @u_kpi_ref, @u_kpi_conf, @u_kpi_m)"
            OldValuesParameterFormatString="original_{0}"
            SelectCommand="SELECT [id], [UserName], [u_kpi], [u_kpi_std], [u_kpi_comm], [u_kpi_rat], [u_kpi_fx], [u_kpi_rec], [uM_kpi_rec], [u_kpi_ref], [u_kpi_conf], [u_kpi_m] FROM [u_kpi_table] WHERE (([u_kpi_m] = @u_kpi_m) AND ([u_kpi_rec] &lt;&gt; @u_kpi_rec)) ORDER BY [UserName]"
            UpdateCommand="UPDATE [u_kpi_table] SET [uM_kpi_rec] = @uM_kpi_rec WHERE [id] = @original_id ">
            <DeleteParameters>
                <asp:Parameter Name="original_id" Type="Object" />
                <asp:Parameter Name="original_UserName" Type="String" />
                <asp:Parameter Name="original_u_kpi" Type="String" />
                <asp:Parameter Name="original_u_kpi_std" Type="String" />
                <asp:Parameter Name="original_u_kpi_comm" Type="String" />
                <asp:Parameter Name="original_u_kpi_rat" Type="Int32" />
                <asp:Parameter Name="original_u_kpi_fx" Type="String" />
                <asp:Parameter Name="original_u_kpi_rec" Type="Int32" />
                <asp:Parameter Name="original_uM_kpi_rec" Type="Int32" />
                <asp:Parameter Name="original_u_kpi_ref" Type="String" />
                <asp:Parameter Name="original_u_kpi_conf" Type="String" />
                <asp:Parameter Name="original_u_kpi_m" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="id" Type="Object" />
                <asp:Parameter Name="UserName" Type="String" />
                <asp:Parameter Name="u_kpi" Type="String" />
                <asp:Parameter Name="u_kpi_std" Type="String" />
                <asp:Parameter Name="u_kpi_comm" Type="String" />
                <asp:Parameter Name="u_kpi_rat" Type="Int32" />
                <asp:Parameter Name="u_kpi_fx" Type="String" />
                <asp:Parameter Name="u_kpi_rec" Type="Int32" />
                <asp:Parameter Name="uM_kpi_rec" Type="Int32" />
                <asp:Parameter Name="u_kpi_ref" Type="String" />
                <asp:Parameter Name="u_kpi_conf" Type="String" />
                <asp:Parameter Name="u_kpi_m" Type="String" />
            </InsertParameters>
            <SelectParameters>
                <asp:ControlParameter ControlID="Label_UserName" Name="u_kpi_m"
                    PropertyName="Text" Type="String" />
                <asp:Parameter DefaultValue="0" Name="u_kpi_rec" Type="Int32" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="UserName" Type="String" />
                <asp:Parameter Name="u_kpi" Type="String" />
                <asp:Parameter Name="u_kpi_std" Type="String" />
                <asp:Parameter Name="u_kpi_comm" Type="String" />
                <asp:Parameter Name="u_kpi_rat" Type="Int32" />
                <asp:Parameter Name="u_kpi_fx" Type="String" />
                <asp:Parameter Name="u_kpi_rec" Type="Int32" />
                <asp:Parameter Name="uM_kpi_rec" Type="Int32" />
                <asp:Parameter Name="u_kpi_ref" Type="String" />
                <asp:Parameter Name="u_kpi_conf" Type="String" />
                <asp:Parameter Name="u_kpi_m" Type="String" />
                <asp:Parameter Name="original_id" Type="Object" />
                <asp:Parameter Name="original_UserName" Type="String" />
                <asp:Parameter Name="original_u_kpi" Type="String" />
                <asp:Parameter Name="original_u_kpi_std" Type="String" />
                <asp:Parameter Name="original_u_kpi_comm" Type="String" />
                <asp:Parameter Name="original_u_kpi_rat" Type="Int32" />
                <asp:Parameter Name="original_u_kpi_fx" Type="String" />
                <asp:Parameter Name="original_u_kpi_rec" Type="Int32" />
                <asp:Parameter Name="original_uM_kpi_rec" Type="Int32" />
                <asp:Parameter Name="original_u_kpi_ref" Type="String" />
                <asp:Parameter Name="original_u_kpi_conf" Type="String" />
                <asp:Parameter Name="original_u_kpi_m" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>--%>
        </div>
        <asp:Label ID="Label_UserGuide" runat="server" Visible="False"></asp:Label>
</asp:Content>
